<template>
	<view>
		<!-- 图片视频介绍 -->
		<view class="cont-introduce cont-back">
			<view class="img-video">简历介绍</view>
			<view>
				<!--这是增加视频封面图片 controls poster="图片链接" -->
				<video objectFit="fill" v-if="!videoing" :src="staticvideo" ></video>
				<!--controls poster就是那个视频的封面-->
				<view>
					<block v-for="(items,index) in detaildata.staticimg" :key="index">
						<image :src="items" mode="widthFix"></image>
					</block>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		name:'matter',
		props:{//这个玩意接收值的，别搞错了，那个函数要放data里面写
			detaildata:Object,
		},
		data(){
			return{
				videoing:false,
				staticvideo:''
			}
		},
		watch:{//这个是用来监听视频的，要是没有视频就不会出现一闪而过的视频组件
			detaildata(newvalue,oldvalue){
				console.log(newvalue.staticvideo)
				if(newvalue.staticvideo !=''){
					console.log(newvalue.staticvideo)
					this.staticvideo = newvalue.staticvideo
					this.videoing=true
				}else{
					this.videoing=false
					console.log('没有视频')
				}
				
			}
		}
	}
	
	
</script>

<style scoped>
	.cont-back{
		padding: 20upx;
		background: #FFFFFF;
	}
	.cont-introduce{
		margin-top: 20upx;
	}
	.img-video{
		color: #333333;
		font-size:30upx;
		font-weight: bold;
		padding: 20upx 0;
	}
	.cont-introduce video,image{width: 100%;}
	.cont-introduce video{margin-bottom: 20upx;}
	
</style>
